function deepclone(obj,hash=new WeakMap()){
    if(obj===null) return obj;
    if(obj instanceof Date) return new Date(obj);
    if(obj instanceof RegExp) return new RegExp(obj);
    if(typeof obj!="object") return obj;
    // 查表，防止循环拷贝
    if(hash.get(obj)) return hash.get(obj);
    //在堆内存新建一个对象
    let cloneobj=new obj.constructor()
    //哈希表设值
    hash.set(obj,cloneobj)
    //遍历参数的键
    for(let key in obj){
        if(obj.hasOwnProperty(key)){
            cloneobj[key]=deepclone(obj[key],hash)
        }
    }
    return cloneobj
}